package com.itheima.abstractdemo;

public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.eat();
        dog.drink();
        Cat cat = new Cat();
        cat.eat();
        cat.drink();
    }
}
//动物类//吃//喝
abstract class Animal{
    public void drink(){
        System.out.println("喝水");
    }
    public abstract void eat();
}
//狗类//吃肉
class  Dog extends Animal{
    @Override
    public void eat() {
        System.out.println("狗吃肉");
    }
}
//猫类//吃鱼
class  Cat extends Animal{
    @Override
    public void eat() {
        System.out.println("猫吃鱼");
    }
}